<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true" scan="true" scanPeriod="40 seconds">

	<property name="log.base" value="logs" />

	<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
		<resetJUL>true</resetJUL>
	</contextListener>

	<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
		<encoder charset="UTF-8" class="{{pack}}.log.LogEncoder">
			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%logger{50}:%line] - %tmsg%n</pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>


	<appender name="FILE-ERROR"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>ERROR</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
		<append>true</append>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.base}/{{lappName}}-error.%d{yyyy-MM-dd}.log
			</fileNamePattern>
			<maxHistory>10</maxHistory>
		</rollingPolicy>
		<encoder charset="UTF-8" class="{{pack}}.log.LogEncoder" >
			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%logger{50}:%line] - %tmsg%n</pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>


	<appender name="FILE-INFO"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>INFO</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
		<append>true</append>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.base}/{{lappName}}-info.%d{yyyy-MM-dd}.log
			</fileNamePattern>
			<maxHistory>5</maxHistory>
		</rollingPolicy>
		<encoder charset="UTF-8"  class="{{pack}}.log.LogEncoder">
			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%logger{50}:%line] - %tmsg%n</pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>

	<appender name="FILE-WARN"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>WARN</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
		<append>true</append>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.base}/{{lappName}}-warn.%d{yyyy-MM-dd}.log
			</fileNamePattern>
			<maxHistory>10</maxHistory>
		</rollingPolicy>
		<encoder charset="UTF-8"  class="{{pack}}.log.LogEncoder">
		    <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%logger{50}:%line] - %tmsg%n</pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>

	<appender name="FILE-DEBUG"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>DEBUG</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
		<append>true</append>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.base}/{{lappName}}-debug.%d{yyyy-MM-dd}.log
			</fileNamePattern>
			<maxHistory>1</maxHistory>
		</rollingPolicy>
		<encoder charset="UTF-8" class="{{pack}}.log.LogEncoder" >
			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%logger{50}:%line] - %tmsg%n</pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>

	<logger level="DEBUG" name="{{rootPack}}.mapper" additivity="false">
	   <appender-ref ref="FILE-DEBUG" />
     <appender-ref ref="FILE-INFO"  />
     <appender-ref ref="FILE-WARN"  />
     <appender-ref ref="CONSOLE" />
	</logger>


	<root level="INFO">
		<appender-ref ref="FILE-DEBUG" />
		<appender-ref ref="FILE-ERROR" />
		<appender-ref ref="FILE-INFO" />
		<appender-ref ref="CONSOLE" />
	</root>

</configuration>
